-- 43.lua
-- Created by zouyb Jan/05/2016
-- 骷髅术士BUFF光效

return {
    onDie = function(monster)    
        -- 当前怪物的基类ID
        local baseClassId = monster:query("base_class_id");

        -- 播放死亡光效
        local monsterGrid = UIDungeonMgr:getCurLevel().grids[monster:getPos()];
        playEffect(monsterGrid, 1184);

        -- 获取其他所有同类
        local openMonsterGrids = UIDungeonMgr:getCurLevel():getOpenMonsterGrids();
        local count = 0;
        for i = 1, #openMonsterGrids do
            local monsterGrid = openMonsterGrids[i];
            if monsterGrid.gridData.monster.style == MONSTER_STYLE_UNDEAD then
                playAddBuffEffect(monsterGrid, BUFF_TYPE_ATTACK);
				
				local function playEffect()
				    playAddBuffEffect(monsterGrid, BUFF_TYPE_HP);
				end
				
                performWithDelay(monsterGrid, playEffect, 0.3);    
            end
        end
    end,
};